package pkg

import (
	"encoding/json"
	"github.com/Baidu-AIP/golang-sdk/aip/censor"
)

type Chenkte struct {
	ConclusionType uint `json:"conclusionType"`
}

func Chect(message string) bool {
	//通过access_toke
	client := censor.NewClient("API_KEY", "SECRET_KEY")
	res := client.TextCensor(message)
	var chect Chenkte
	json.Unmarshal([]byte(res), &chect)
	if chect.ConclusionType == 1 {
		return true
	}
	return false

}
